import request from '@/utils/request'

let dev_url = process.env.VUE_APP_BASE_API
const modUrl = `course`
const uploadUrl = '/dev/fileserver/uploadImg'
export default {
    /* 分页路径 */
    listPage(current, pageSize, query) {
        return request({
            url: `${modUrl}/query/page/${current}/${pageSize}`,
            method: 'get',
            params: query
        })
    },
    add(params) {
        return request({
            url: `${modUrl}/add`,
            method: 'post',
            data: params
        })
    },
    update(params) {
        return request({
            url: `${modUrl}/update`,
            method: 'put',
            data: params
        })
    },
    deleteByIds(deleteIds) {
        return request({
            url: `${modUrl}/deleteByIds`,
            data: {ids: deleteIds},
            method: 'delete',
        })
    },

    queryOne(courseNo) {
        return request({
            url: `${modUrl}/query/one/${courseNo}`,
            method: 'get',
        })
    },

    uploadUrl,
    updateImgUrl(params) {
        return request({
            url: `${modUrl}/updateImgUrl`,
            method: 'put',
            data: params
        })
    },
}